<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
		<meta http-equiv="description" content="ebb365">
		<style type="text/css">
			.vb_wid {width:100%; margin: 0 auto; border-top:1px #FDB18D solid; background:#F5F5F5; color:#FE6500; text-indent:20px; line-height:25px; font-size:12px;}
			.fb_search {width:100%; margin:0 auto; margin-top:20px; border:1px #FFCD7F solid;}
			.fb_search h1 {background:#FFEFBB; margin:0px; padding:0px; line-height:28px; text-indent:10px; font-size:14px;}
			.fb_ddd {width:100%; margin:0 auto; margin-top:10px; border-top:3px #FFCC00 solid; background:url(homeSite/directSeed/images/pen.gif) no-repeat 5px 3px; height:40px; text-indent:50px; line-height:40px; color:#464646; font-size:12px;}
			.fb_nr {width:100%; margin:0 auto; margin-top:10px; line-height:40px; font-size:12px; color:#464646}
			.fb_nr span {color:#CCC;}
			.fb_nr tr {height:50px;}
			.fb_nr select {color:464646; font-size:12px;}
			.fb_nr Div {margin-left:10px;}
			.fb_nr .table11 {border-top:1px #FFCC66 solid; background:#FFF2D7;}
			.fb_nr .table22 {border-top:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
			.fb_nr .table33 {border-top:1px #FFCC66 solid; border-bottom:1px #FFCC66 solid; background:#FFF2D7;}
			.fb_nr .table44 {border-top:1px #E1E1E1 solid; border-bottom:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
			.inputtttt {border:1px #DEA303 solid; height:20px; color:#464646; font-size:12px; background:url(homeSite/directSeed/images/bottom_bg.jpg) repeat-x left top;}
			.lb {background:#FFCD7F; color:#464646; font-weight:bold; text-align:center; height:30px; line-height:30px;}
			.lb1 {border-bottom:1px #000000 dashed; height:28px;}
			.lb1 td {border-bottom:1px #ccc dashed; background:#eefefe}
		</style>
		<script type='text/javascript' src='/dwr/interface/homeSiteDWRServ.js'></script>
		<script type='text/javascript' src='/dwr/engine.js'></script>
		<script type='text/javascript' src='/dwr/util.js'></script>

		<script type="text/javascript">
		<!--//
				function checkForm(){
				  var f = document.forms[1];
				  if(f.lanmuname.value==''){
				     alert('期刊名称不能为空！');
				     return false;
				  }
				   if(f.lanmuname.value.length>50){
				     alert('期刊名称过长，最大中文25，英文50！');
				     return false;
				  }				  
				  return true;
				}
				
			function getDirectSeedNameMap(obj){
		    	homeSiteDWRServ.loadDirectSeedNameMapByInputtime(obj.value,getAllDirectSeedNameMap);
	 		}
		    function getAllDirectSeedNameMap(data){
				var magazineNameid = document.getElementById("directSeedNameId");
		      	DWRUtil.removeAllOptions(magazineNameid);
		      	DWRUtil.addOptions(magazineNameid, {'-1':'请选择'}); 
		      	DWRUtil.addOptions(magazineNameid, data); 
		    }
			function showDirectSeedClass(obj){
				var curYear = document.getElementById('curYear').value;
				var id = obj.value;
				window.location.href = "/admin/directSeedClass.do?action=select&nameId="+id+"&curYear="+curYear;
			}
			function load(obj){
		    	homeSiteDWRServ.loadDirectSeedNameMapByInputtime(obj,getAllDirectSeedNameMap);
	 		}
			 -->	
		</script>
		<style type="text/css">
	<!--
	.STYLE1 {font-size: 12px}
	-->
	</style>
	</head>
	<body>		
		<div class="vb_wid">【直播栏目添加后台】</div>
		<div class="fb_ddd">直播栏目添加</div>
		<html:form action="/admin/directSeedClass.do?action=list" method="post">	
			<table width="100%" border="1" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td colspan="6"bgcolor="#F6F6F6" >
					请选择直播年份：
					<select onchange="getDirectSeedNameMap(this);" id="curYear">
					
					<option value="2006" <c:if test="${curYear=='2006'}">selected</c:if>>2006</option>
					<option value="2007" <c:if test="${curYear=='2007'}">selected</c:if>>2007</option>
					<option value="2008" <c:if test="${curYear=='2008'}">selected</c:if>>2008</option>
					<option value="2009" <c:if test="${curYear=='2009'}">selected</c:if>>2009</option>
					<option value="2010" <c:if test="${curYear=='2010'}">selected</c:if>>2010</option>
					<option value="2011" <c:if test="${curYear=='2011'}">selected</c:if>>2011</option>
					<option value="2012" <c:if test="${curYear=='2012'}">selected</c:if>>2012</option>
					</select>
					&nbsp;&nbsp;&nbsp;&nbsp;
					该年份下的直播名：
					<html:select property="directSeedNameId" onchange="showDirectSeedClass(this);">
						<option value="-1">选择直播</option>
						<logic:present name="directSeedNameMap">
		     			<logic:iterate id="map" name="directSeedNameMap">
		     				<option value="${map.key}" <c:if test="${directSeedName.id==map.key}">selected</c:if> >${map.value}</:option>
		     			</logic:iterate>
		     		</logic:present>
					</html:select>
				</td>
			</tr>
			<tr>
				<td height="26" width="10%" bgcolor="#FEDFC0">
					<div align="center" class="STYLE1">
						栏目ID
					</div>
				</td>
				<td bgcolor="#FEDFC0">
					<div align="center" class="STYLE1">
						期刊名称
					</div>
				</td>
				<td bgcolor="#FEDFC0">
					<div align="center" class="STYLE1">
						栏 目
					</div>
				</td>
				
				<td bgcolor="#FEDFC0" width="10%">
					<div align="center" class="STYLE1">
						是否推荐
					</div>
				</td>
				<td bgcolor="#FEDFC0" width="10%">
					<div align="center" class="STYLE1">
						是否删除
					</div>
				</td>
				
				<td bgcolor="#FEDFC0" width="18%">
					<div align="center" class="STYLE1" width="10%">
						录入时间
					</div>
				</td>
				
			</tr>
			<logic:notEmpty name="directSeedClassList">
				<logic:iterate id="list" name="directSeedClassList">
					<tr align="center" class="lb1">
						<td height="22px">
							${list.id}
						</td>

						<td>
							<c:set var="qkName" value="${list.dsName}" />
										${fn:substring(qkName,0,15)}
						</td>

						<td>
							<c:set var="lanmuname" value="${list.lanmuname}" />
										${fn:substring(lanmuname,0,10)}
						</td>

						<td>
							${list.iftj!=0?'★':'☆'}

						</td>

						<td>
							${list.shanchu!=0?'★':'☆'}
						</td>

						<td>
							<bean:write name="list" property="inputdate" format="yyyy年MM月dd日"/>
						</td>

					</tr>
				</logic:iterate>
			</logic:notEmpty>
		</table>
		
		</html:form>
		
		
		<html:form action="/admin/directSeedClass.do?action=add&curYear=${curYear}" method="post" onsubmit=" return checkForm();">

				<div class="fb_nr">
				   <font color="red" size="3">提：选择年份 >> 选择直播 >> 确定添加</font>
				  <table width="100%" border="0" cellpadding="0" cellspacing="0">
				    <tr>
					      <td width="17%" align="center" class="table11">直播名称:</td>
					      <td width="83%" class="table22"><div><label>
					        <html:text property="" value="${directSeedName.qiname}" readonly="true" size="40" ></html:text>
							<html:hidden property="directSeedNameId" value="${directSeedName.id}"/>
					      	</label>
					     	</div>
					      </td>
				    </tr>
				    <tr>
					      <td width="17%" align="center" class="table11">栏目标题:</td>
					      <td width="83%" class="table22"><div><label>
					        <input type="text" name="lanmuname" size="40" />
					        &nbsp;<font color="red">*</font>
					      	</label>
					     	</div>
					      </td>
				    </tr>
				    <tr>
					      <td width="17%" align="center" class="table11">是否推荐:</td>
					      <td width="83%" class="table22"><div><label>
					        <input type="radio" name="iftj" value="1" checked />是
					        <input type="radio" name="iftj" value="0" />否
					      	</label>
					     	</div>
					      </td>
				    </tr>
				    <tr>
					      <td width="17%" align="center" class="table11">是否删除:</td>
					      <td width="83%" class="table22"><div><label>
					         <input type="radio" name="shanchu" value="1"/>是
					        <input type="radio" name="shanchu" value="0" checked/>否
					      	</label>
					     	</div>
					      </td>
				    </tr>
				   	<tr style="height:50px;">
				      <td align="center"></td>
				      <td><label>
				      		<logic:present name="directSeedName">
								<input type="submit" name="Submit" value=" 添 加 " class="inputtttt" />
							</logic:present>
							<logic:notPresent name="directSeedName">
								<input type="submit" name="Submit" value=" 添 加 " class="inputtttt" disabled="disabled"/>
							</logic:notPresent>
							
							&nbsp;
							<input type="reset" name="Submit2" value=" 重 置 " class="inputtttt" />
							&nbsp;
				      
				      </label></td>
				    </tr>
				  </table>
			</div>
		</html:form>
		<logic:present name="msg">
			<bean:write name="msg" filter="false"/>
		</logic:present>
	</body>
</html>
